package com.tj.admin.auth.enums;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * @ClassName:
 * @Description:
 * @Author yuyanqi
 * @Create 2017/3/21 0021 下午 2:44
 */
public enum RoleKeyEnum {

    SUPERADMIN("SUPERADMIN", "超级管理员"),
    COLLECT_LEADER("COLLECT_LEADER", "催收主管"),
    COLLECT_STAFF("COLLECT_STAFF", "催收专员"),

    CUSTOMER_SERVICE("CUSTOMER_SERVICE", "客服CS"),
    COLLECT_S1("COLLECT_S1", "内催S1"),
    COLLECT_S2("COLLECT_S2", "内催S2"),
    COLLECT_OUT_M1("COLLECT_OUT_M1", "外催M1"),
    COLLECT_OUT_M2("COLLECT_OUT_M2", "外催M2"),
    COLLECT_OUT_M3("COLLECT_OUT_M3", "外催M3"),

    AUDITOR_HEADMAN("AUDITOR_HEADMAN", "信审组长"),

    AUDITOR_PHOTO("AUDITOR_PHOTO", "信审-照片"),//node=3 目前有效的 20191125
    AUDITOR_CALL("AUDITOR_CALL", "信审-电话"),//node=1
    AUDITOR_FINAL("AUDITOR_FINAL", "信审-终审"),//node=5

    NBFC_CASHMAMA_OWER("NBFC_CASHMAMA_OWER", "NBFC-自有资金"),
    NBFC_KRAZYBEE("NBFC_KRAZYBEE", "NBFC-KrazyBee"),
    NBFC_ZAVRON("NBFC_ZAVRON", "NBFC-Zavron"),
    FUND_MANAGER_CN("FUND_MANAGER_CN", "FUND_MANAGER_CN"),
    FUND_MANAGER("FUND_MANAGER", "FUND_MANAGER"),
    MULTIPLE_MERCHANT("MULTIPLE_MERCHANT", "MULTIPLE_MERCHANT"),
    ;

    private String type;

    private String desc;

    RoleKeyEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public RoleKeyEnum setType(String type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public RoleKeyEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static List<RoleKeyEnum> getCollectionAllPermissionEnum() {
        return Lists.newArrayList(RoleKeyEnum.SUPERADMIN, RoleKeyEnum.COLLECT_LEADER);
    }

    public static RoleKeyEnum getEnumByType(String type) {
        RoleKeyEnum RoleKeyEnum = null;
        for (RoleKeyEnum e : RoleKeyEnum.values()) {
            if (e.getType().equals(type)) {
                RoleKeyEnum = e;
            }
        }

        return RoleKeyEnum;
    }
}
